import socket
import time
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sk.connect(("127.0.0.1", 10101))
l = '{"start":1, "count_id":1}'
# while True:
    # msg = sk.recv(1024)  # 最多接受1024字节
    # print(msg)
sk.send(0x4c.to_bytes(1, byteorder="little", signed=False))
sk.send(0x45.to_bytes(1, byteorder="little", signed=False))
sk.send(0x04.to_bytes(1, byteorder="little", signed=False))
len_of_msg = len(l)
sk.send(len_of_msg.to_bytes(4, byteorder="little", signed=False))
sk.send(0x4c.to_bytes(1, byteorder="little", signed=False))
sk.send(0x45.to_bytes(1, byteorder="little", signed=False))
sk.send(l.encode("utf8"))
while True:
    pass
# sk.close()